java.lang.ObjectAlarm
public class Alarm
The Alarm Class creats an alarm for a European-style 12 hour clock.
| Constructor Summary | |
|---|---|
Alarm()
Constructor for objects of class Alarm. |
|
Alarm(int hour,
int minute,
java.lang.String choice,
java.lang.Boolean onOff)
Constructor for objects of class Alarm. |
|
| Method Summary | |
|---|---|
java.lang.String |
getTime()
Return the current time of this display in the format HH:MM. |
java.lang.Boolean |
isSet()
this method returns true if the alarm clock was set and false if it wasnt set. |
void |
setTime(int hour,
int minute,
java.lang.String choice)
This method sets the time of the alarm to the specified hour and minute. |
java.lang.String |
turnOff()
This method turns the alarm off, if the alarm was on it turns it off and if the alarm was already on off changes occur. |
java.lang.String |
turnOn()
This method turns the alarm on, if the alarm was off it turns it on and if the alarm was already on no changes occur. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Alarm()
public Alarm(int hour,
int minute,
java.lang.String choice,
java.lang.Boolean onOff)
hour: - the hour that the user would like the clockminute: - the minute that will be displayed if 60 rollsover to 0.choice: - lets the user choose if the time is am/pm.onOff: - sets the alarm to either on or off.| Method Detail |
|---|
public java.lang.String getTime()
public java.lang.Boolean isSet()
public void setTime(int hour,
int minute,
java.lang.String choice)
hour: - the hour that the user would like the clockminute: - the minute that will be displayed if 60 rollsover to 0.choice: - lets the user choose if the time is am/pm.public java.lang.String turnOff()
public java.lang.String turnOn()